<?php include "header.php"; ?>

<script>
	function validate() {
		if (document.formName.kode.value == "" || document.formName.kode.value == null) {
			addErrorStyle('#kode');
			return false;
		} else if (document.formName.nama_debitur.value == "" || document.formName.nama_debitur.value == null) {
			addErrorStyle('#nama_debitur');
			return false;
		} else if (document.formName.alamat.value == "" || document.formName.alamat.value == null) {
			addErrorStyle('#alamat');
			return false;
		} else if (document.formName.no_telp.value == "" || document.formName.no_telp.value == null) {
			addErrorStyle('#no_telp');
			return false;
		} else {
			return true;
		}
	}
</script>

<form name="formName" action="process_insert.php" method="post" role="form" onsubmit="return validate();">
	<div class="form-group">
		<label for="kode">Kode</label>
		<input type="text" name="kode" class="form-control" id="kode" />
	</div>
	
	<div class="form-group">
		<label for="nama_debitur">Nama Debitur</label>
		<input type="text" name="nama_debitur" class="form-control" id="nama_debitur" />
	</div>
	
	<div class="form-group">
		<label for="alamat">Alamat</label>
		<input type="text" name="alamat" class="form-control" id="alamat" />
	</div>
	
	<div class="form-group">
		<label for="no_hp">No. Hp.</label>
		<input type="text" name="no_hp" class="form-control" id="no_hp" />
	</div>
	
	<div class="form-group">
		<label for="no_telp">No. Telp.</label>
		<input type="text" name="no_telp" class="form-control" id="no_telp" />
	</div>

	<div class="form-group">
		<button type="submit" class="btn btn-primary">Save Changes</button>
		<button type="reset" class="btn btn-danger">Reset</button>
	</div>
</form>

<?php include "footer.php" ?>